<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>用户中心_{$web_name}</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="Keywords" content="用户中心" />
		<meta name="Description" content="用户中心" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
		<meta name="format-detection" content="telephone=no">
		<tc_include file="Public:head" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/User/css/user.css" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/User/css/user_common.css" />
		<style type="text/css">
			.inputbg {
				border: 1px solid #ddd;
				height: 30px;
				width: 200px;
				line-height: 30px;
				padding: 0px 5px;
				margin-right: 5px;
				color: #333333;
			}
			
			input::-webkit-outer-spin-button,
			input::-webkit-inner-spin-button {
				-webkit-appearance: none !important;
			}
			
			.phonecode {
				background: #F6F6F6;
				border: 1px solid #d9d9d9;
				cursor: pointer;
				padding: 0 8px;
				display: inline-block;
				line-height: 33px;
				height: 33px;
				color: #666;
				margin-left: 10px;
				text-align: center;
				width: 120px;
				vertical-align: middle;
			}
		</style>
	</head>

	<body>

		<tc_include file="Public:nav" />
		<div class="w990" id="content" style="background: none;">
			<div class="margin-w1210 clearfix">
				<div class="w">
					<div class="breadcrumb clearfix">
						<a href="/" class="index">首页</a> <span class="crumbs-arrow">&gt;</span> <span class="last">用户中心</span></div>
				</div>
				<div class="blank"></div>
				<tc_include file="Public:user_left" />
				<div class="user-right">
					<div class="box">

						<div class="tabmenu">
							<ul class="tab pngFix">
								<li class="first active">我的支付宝</li>
							</ul>
						</div>

						<div class="alert alert-success">
							<h4>操作提示：</h4>
							<ul>
								<li>该支付宝帐号用于提现操作。</li>
							</ul>
						</div>
						<div class="ncm-user-profile">
							<div class="ncm-default-form" id="con_tab_1" style="display: block;">
								<table width="100%" border="0" cellpadding="10" cellspacing="1" bgcolor="#eee">
									<tbody>
										<tr>
											<td width="35%" align="right">支付宝账号：</td>
											<td width="65%" align="left">
												<input type="text" name="ali_number" value="{$userinfo['ali_number']}" size="25" class="inputbg" style="ime-mode:disabled">
												<span id="username_message" style="color:#E31939"></span>
											</td>
										</tr>
										<tr>
											<td align="right">真实姓名：</td>
											<td align="left">
												<input type="text" name="ali_name" value="{$userinfo['ali_name']}" size="25" class="inputbg" style="ime-mode:disabled">
											</td>
										</tr>
										<tr>
											<td align="right">手机号：</td>
											<td align="left">
												{$userinfo['phone']}
											</td>
										</tr>
										<tr>
											<td align="right">验证码：</td>
											<td align="left">
												<input type="text" name="code" value="" size="25" class="inputbg code" style="ime-mode:disabled">
												<a href="javascript:void(0);" class="phonecode">获取短信校验码</a>
											</td>
										</tr>
										<tr>
											<td colspan="2" align="center">
												<label class="submit-border">
					                          		<input class="act" type="hidden" value="act_edit_profile">
					                          		<input name="submit" type="button" class="main-btn main-btn-large ali_edit" value="确认修改">
					                        	</label>
											</td>
										</tr>
									</tbody>
								</table>

							</div>

						</div>
					</div>
				</div>

			</div>
		</div>
		<div style="clear: both;"></div>

		<tc_include file="Public:footer" />
		<script type="text/javascript">
			$('.ali_edit').click(function(){
				var ali_number=$('input[name=ali_number]').val();
				var ali_name=$('input[name=ali_name]').val();
				var code=$('input[name=code]').val();
				if(ali_number==''||ali_name==''||code==''){
					layer.msg('请填写完整');
					return;
				}
				$.post('/user/ali', {
					ali_number: ali_number,
					ali_name: ali_name,
					code: code,
				}, function(result) {
					if(result==0){
						layer.msg('保存失败');
						return;
					}
					if(result==1){
						layer.msg('保存成功');
						return;
					}
					if(result==2){
						layer.msg('验证码不正确');
						return;
					}
						
				}, "json");
			})
			// 获取验证码链接点击事件
			$(".phonecode").prop("disabled", false);
			$(".phonecode").click(function() {

				// 获取短信验证码
				var target = this;
				
				var mobile ="{$userinfo['phone']}";
				var type=$(this).prop("disabled");
			
				if(type==false){
					$.post('/user/sms_captcha_ali', {
						mobile: mobile,
					}, function(result) {
						if(result.code == 0) {
							layer.msg(result.message)
	
						} else {
							// 开始倒计时
							countdown(target, "获取短信验证码");
							layer.msg(result.message)
	
						}
						$(target).data("doing", false);
					}, "json");
				}
				
			});
			var wait = 60;

			function countdown(obj, msg) {
				obj = $(obj);

				if(wait <= 0) {
					obj.prop("disabled", false);
					obj.html(msg);
					wait = 60;
				} else {
					if(msg == undefined || msg == null) {
						msg = obj.html();
					}
					obj.prop("disabled", true);
					obj.html(wait + "秒后重新获取");
					wait--;
					setTimeout(function() {
						countdown(obj, msg)
					}, 1000)
				}
			}
		</script>
	</body>

</html>